package com.surveillance.BO;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.surveillance.DAO.ExamenDao;
import com.surveillance.entities.Examen;

@Service("ExamenBO")
public class ExamenBO implements BOLayer<Examen> {
	@Autowired
	private ExamenDao examenDAO;

	public void setExamenDAO(ExamenDao examenDAO) {
		this.examenDAO = examenDAO;
	}

	@Override
	public boolean save(Examen myEntity) {
		examenDAO.save(myEntity);
		return true;
	}

	@Override
	public void update(Examen myEntity) {
		examenDAO.update(myEntity);

	}

	@Override
	public void delete(Examen myEntity) {
		examenDAO.delete(myEntity);

	}

	@Override
	public Examen findByID(Long myEntityID) {

		return examenDAO.findByID(myEntityID);
	}

	@Override
	public List<Examen> findAll() {
		return ((ExamenDao) examenDAO).findAll();
	}
	public List getExamensByNiveauSpec(int niveau, boolean isMedecine){
		return ((ExamenDao) examenDAO).getExamensByNiveauSpec(niveau, isMedecine);
	}

	public List getDatesDesExamen(Date dateDebut,Date dateFin){
		return ((ExamenDao) examenDAO).getDatesDesExamen(dateDebut, dateFin);
	}
}
